#include"myshell.h"

#define SIZE 1024
char commandstr[SIZE];

int main()
{
    while(true)
    {
        InitGargv();
        //1.输出命令行提示符
        PrintCommandPrompt();
        //2.获取用户输入的命令
        if(!GetCommandStr(commandstr,SIZE))
            continue;
        //3."ls -a -l > "ls" "-a" "-l"解析命令行参数
        ParseCommandString(commandstr);
        
        //4.内建命令
        if(BuiltInCommandExec())
            continue;

        //5.执行命令
        ForkAndExec();
    }
    return 0;
}

